import os
import sys

env = Environment()

objs = []

# Lapack
objs += Glob('../../Lapack/Blas/*.c')
objs += Glob('../../Lapack/F2c/*.c')
objs += Glob('../../Lapack/Install/*.c')
objs += Glob('../../Lapack/Scr/*.c')

# Linear Algebra
objs += Glob('../../LinearAlgebra/*.c')

# get current directory
cwd     = os.getcwd()
path    = [os.path.join(cwd, './')]
path   += [os.path.join(cwd, '../../')]
path   += [os.path.join(cwd, '../../LinearAlgebra')]
path   += [os.path.join(cwd, '../../Lapack/Blas')]
path   += [os.path.join(cwd, '../../Lapack/F2c')]
path   += [os.path.join(cwd, '../../Lapack/Install')]
path   += [os.path.join(cwd, '../../Lapack/Scr')]

env.Program(target = "pc_linsolve", source = objs + Glob('./pc_linsolve.c'), CPPPATH = path, LIBS=['m'])
env.Program(target = "pc_lu", source = objs + Glob('./pc_lu.c'), CPPPATH = path, LIBS=['m'])
env.Program(target = "pc_qr", source = objs + Glob('./pc_qr.c'), CPPPATH = path, LIBS=['m'])
env.Program(target = "pc_eig", source = objs + Glob('./pc_eig.c'), CPPPATH = path, LIBS=['m'])
env.Program(target = "pc_svd", source = objs + Glob('./pc_svd.c'), CPPPATH = path, LIBS=['m'])
env.Program(target = "pc_state_space", source = objs + Glob('./pc_state_space.c'), CPPPATH = path, LIBS=['m'])
env.Program(target = "pc_model_predictive_control", source = objs + Glob('./pc_model_predictive_control.c'), CPPPATH = path, LIBS=['m'])
